const express = require('express')
const ejs = require('ejs');
const path = require('path');
const app = express();
const indexRouter = require('./router/user')

app.use(express.json())
app.use(express.urlencoded({ extended: false }))
app.set('views', path.join(__dirname, 'views'))
app.set('view engine', 'html')
app.engine('html', ejs.renderFile)

app.use(express.static(__dirname + '/public'))
app.use('/', indexRouter)


app.listen(8000, () => {
  console.log(`server port is 8000`)
})